/* @Date 03 March 2008
 * @Author Hussein Patwa
 * Class for the main local trending algorithm (Fig 7 on KDD paper)
 */

import java.util.Set;

public class local
{
	Set posTrend = new Set; // container for negative trends
	Set negTrend = new Set; // container for positive trends
	set paths = new Set(values); // set containing paths from values array (PROBLEM!)
	Set obs = new Set; // container for observations
	int minLength; // min length above which trend is considered established
	int maxLength; // max length above which trend is assumed
	int distX; // distance from x co-ordinate 
	int distY; // distance from Y co-ordinate 
	spatialobject path[30] = new spatialobject; // an array to hold the spatialobjects comprising the path
	int corr; // something to hold the corrolation
	
	public void findTrends 
	{
		while(paths !=null)
		{
			obs == null;
			path[1] = paths[1][1]; // Move first element of paths to path
			int i;
			for(i=minLength; i<=maxlength; i++) // initialise counter that will track through the colums of the set paths
			{
				distX = paths[1][i].x - paths[1].x; // calculate the difference in the x co-ordinate
				distY = paths[1][i].y - paths[1].y; // calculate the difference in the y co-ordinate
				obs[1][0] = distX; // insert distX into observations
				obs[1][1] = distY;// insert distY into observations
				// Regression function
				// Corrolation function
			}
			if(corr > 0) // Insert the path and corolation into the set posTrend or negTrend
			{
				posTrend[0][0 = path;
				posTrend[0][1] = corr;
			}
			else
			{
				negTrend[0][0] = path;
				negTrend[0][1] = corr;
			}
		}
	
		// Method to show pos or neg trend set 
	public void viewTrend{String trendDir)
	{
	}
	}

}
